﻿String.prototype.format = function () {
    var args = arguments;
    return this.replace(/\{(\d+)\}/g, function (m, n) { return args[n]; });
};
var TgkcTemp = new Object({
    ViewProduct: function (item, n) {
        var div = document.createElement('div');
        var li = document.createElement('li');
        $(div).append($(li));
        var N = n + 8;
        if (N > item.length)
            N = item.length;
        for (var i = n; i < N; i++) {
            $(li).append('<a title="{0}" '.format(item[i][1], item[i][5]) +
                        'onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'img{0}\',\'\',\'http://thegioikimcuong.vn/files/product/{2}\')"'.format(item[i][4], item[i][7], (item[i][3] != '' ? item[i][3] : item[i][2])) +
                        'href="/san-pham/{2}/{1}/{0}">'.format(item[i][4], item[i][6], item[i][7]) +
                        '<img id="img{0}" border="0" alt="{1}" src="http://thegioikimcuong.vn/Files/Product/{3}"'.format(item[i][4], item[i][1], item[i][7], item[i][2]) +
                        ' height="140" /></a>');
        }
        return div.innerHTML;
    }
});

var TgkcTempen = new Object({
    ViewProduct: function (item, n) {
        var div = document.createElement('div');
        var li = document.createElement('li');
        $(div).append($(li));
        var N = n + 8;
        if (N > item.length)
            N = item.length;
        for (var i = n; i < N; i++) {
            $(li).append('<a title="{0}" '.format(item[i][1], item[i][5]) +
                        'onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(\'img{0}\',\'\',\'http://thegioikimcuong.vn/files/product/{2}\')"'.format(item[i][4], item[i][7], (item[i][3] != '' ? item[i][3] : item[i][2])) +
                        'href="/en/product/{2}/{1}/{0}">'.format(item[i][4], item[i][6], item[i][7]) +
                        '<img id="img{0}" border="0" alt="{1}" src="http://thegioikimcuong.vn/Files/Product/{3}"'.format(item[i][4], item[i][1], item[i][7], item[i][2]) +
                        ' height="140" /></a>');
        }
        return div.innerHTML;
    }
});